Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Eror messages from Zou would not be returned properly #341

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

stevenpince
Copy link
Contributor

Problem
Zou returns json objects with the 'error' key instead of 'message'.
As an example; See https://github.com/cgwire/zou/blob/7f217f6be8cbc6eb1b10d80ca465c823b0aede40/zou/app/blueprints/files/resources.py#L705

Solution
I've added a utility function that checks a given request for the presence of both 'message' and 'error' keys, so that the error message of Zou can be properly passed on.

I also updated the UnitTests to test the following scenario's: verifying that the error message raised matches the one given by Zou and properly handling the error message when attempting to create a duplicate working file.

@frankrousseau frankrousseau merged commit 4966a19 into cgwire:master Nov 11, 2024
10 of 11 checks passed
@frankrousseau
Copy link
Contributor

Thank you for this addition.

@EvanBldy we have to make Zou error message more consistent.

@stevenpince
Copy link
Contributor Author

stevenpince commented Nov 12, 2024

I saw the check for Python 2.7 fail. This is most likely caused by the type hinting that I added. Given that 2.7 reached EOL in 2020, and that current versions of Maya also switched to Python3, I'm not really a big fan of supporting 2.7.

That being said, I'll remove the type hinting to make all checks green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants